<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>AllUser</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<style type="text/css">
</style>
<script type="text/javascript">
	function checkID() {
		var select_option = document.getElementById("select_option").value;
		var input_select_option = document
				.getElementById("input_select_option").value;
		if (select_option == 1) {
			if (input_select_option < 0) {
				alert("输入值非法，请重新输入");
				return false;
			} else if (input_select_option > 2147483647) {
				alert("输入值非法，请重新输入");
				return false;
			} else if (isNaN(input_select_option)) {
				alert("输入值非法，请重新输入");
				return false;
			} else {
				return true;
			}
		}

	}
</script>
</head>
<body>
<div style="margin-top:20px; margin-left: 80px;width: 600px;height: 40px;">
   <label style="font-weight: bold;color:red;">查询说明:</label><br/><font style="font-weight: bold;">(1)</font> 在进行编号查询时请您确认您输入的是<font style="font-weight: bold;">数字</font>
   而不是其他字符
   </div>
<div style="margin-left:auto;margin-right:auto ; width: 660px;height: 40px;margin-top: 50px;">
				<form action="<%=basePath%>servlet/BackSearchServlet?type=user"
					method="post" onsubmit="return checkID()">
					<table>
						<tr>
							<td><label style="font-weight: bold;">关键字搜索</label>
							 <select id="select_option"
								name="search" style="height: 30px;">
									<option value="1">按编号搜索</option>
									<option value="2">按姓名搜索</option>
									<option value="3">按生日搜索</option>
									<option value="4">按邮箱搜索</option>
									<option value="5">按电话搜索</option>
									<option value="5">按学校搜索</option>
							</select> <input type="text" name="title" style="width:250px;height: 30px;"placeholder="请输入关键字" id="input_select_option" /> <input
								type="submit" value="搜索" id="btn" style="height: 30px;background:#3358FF;"  /></td>
						</tr>
					</table>
				</form>
			</div>
			<div style="margin-top: 20px;">
<center>
	<table style="border: 1px solid #BCE2F3;">
		<tr style="text-align:center; height: 28px;border-bottom: 1px solid #64B8E4;background: #E4F2FB;">
			<td>用户编号</td>
			<td>用户姓名</td>
			<td>用户生日</td>
			<td>用户邮箱</td>
			<td>用户电话</td>
			<td>用户性别</td>
			<td>用户民族</td>
			<td>用户学历</td>
			<td>用户学校</td>
			<td>相关操作</td>
		</tr>
		<c:forEach items="${userList.list}" var="list">
			<tr style="text-align:center;">
				<td>
				<a style="text-decoration: none;"
					href="<%=basePath%>servlet/UserServlet?m=DetailUserInfo&userId=${list.id}">${list.id }</a>
				
				</td>
				<td>
				<a style="text-decoration: none;"
					href="<%=basePath%>servlet/UserServlet?m=DetailUserInfo&userId=${list.id}">${list.name }</a>
				
				</td>
				<td>${list.birthday }</td>
				<td>
				<a style="text-decoration: none;"
					href="<%=basePath%>servlet/UserServlet?m=DetailUserInfo&userId=${list.id}">${list.email }</a>
				
				
				</td>
				<td>${list.tel }</td>
				<c:if test="${list.sex==1 }">
					<td>男</td>
				</c:if>
				<c:if test="${list.sex==0}">
					<td>女</td>
				</c:if>
				<td>${list.nation }</td>
				<td>${list.education }</td>
				<td>${list.school }</td>
				<td>
					<a style="text-decoration: none;"
					href="<%=basePath%>servlet/UserServlet?m=DeleteUser&userId=${list.id}">删除</a></td>
			</tr>
		</c:forEach>
	</table>
	<div style="margin-top: 20px;">
		<font color="#0000EE">共${userList.maxPage}页</font>&nbsp;&nbsp; <a style="text-decoration: none;"
			href="<%=basePath%>servlet/UserServlet?m=AllUser">第一页</a> <a style="text-decoration: none;"
			href="<%=basePath%>servlet/UserServlet?m=AllUser&method=pre">上一页</a>
		<c:forEach begin="1" end="${userList.maxPage}" step="1" var="i">
	&nbsp;&nbsp;<a style="text-decoration: none;"
				href="<%=basePath%>servlet/UserServlet?m=AllUser&method=index&ind=${i}">${i }</a>
		</c:forEach>
		&nbsp;&nbsp; <a style="text-decoration: none;"
			href="<%=basePath%>servlet/UserServlet?m=AllUser&method=next">下一页</a>
		<a  style="text-decoration: none;"href="<%=basePath%>servlet/UserServlet?m=AllUser&method=last">最后一页</a>
	</div>
	</center>
	</div>
</body>
</html>
